<?
if($opr=="" or $opr=="del")
{
	if(isset($odn_cartid))
	{
		mysql_query("delete from ordernow where odn_cartid = '".$odn_cartid."' ");
	}
$rx = Q1("select * from customer where cust_id = '".$_GET[cust_id]."' ");
?>
<h1 style='color:#9999CC;font-size:18px;'><b>.:: Customer Order ::.</b></h1><br>
<table align=center width="60%" style='border:1px solid #CCCCCC' >
	<tr>
		<td colspan=2><br></td>
	</tr>
	<tr>
		<td width='100' align=right>name : </td>
		<td><?=$rx[cust_firstname]." ".$rx[cust_lastname]?></td>
	</tr>
	<tr>
		<td width='100' align=right>address : </td>
		<td><?=$rx[cust_address]?></td>
	</tr>
	<tr>
		<td width='100' align=right>Tel : </td>
		<td><?=$rx[cust_tel]?></td>
	</tr>
	<tr>
		<td width='100' align=right>Email : </td>
		<td><?=$rx[cust_email]?></td>
	</tr>
	<tr>
		<td colspan=2><br></td>
	</tr>
</table>
<br><br>

<table width='95%' border=0 cellspacing=1 style='color:black;font-weight:bold'>
<tr bgcolor=#036392 style='color:white' height='45'>
	<td align=center>No.</td>
	<td align=center>ORDER-ID</td>
	<td align=center>DATE IN</td>
	<td align=center>DATE ACCEPT</td>
	
	<td align=center>Delete</td>


</tr>
<?
	$rs  =  Q2("select distinct odn_cartid from ordernow where odn_status='1' AND odn_cust = '".$_GET[cust_id]."'  order by date_in DESC,date_accept DESC");
	$ii=1;
	foreach($rs as $r)
	{
?>
<tr bgcolor=#A3E8FC height='30'>
	<td align=center><?=$ii?></td>
	<td align=center><a href='?body=orderview&status=1&odn_cartid=<?=$r[odn_cartid]?>'><?=$r[odn_cartid]?></a></td>
	<? $rx = Q1("select * from ordernow where odn_cartid='".$r[odn_cartid]."'"); ?>
	<td align=center> <?=$rx[date_in]?></td>
	<td align=center> <?=$rx[date_accept]?></td>
	<td align=center><a href='?body=cust_order&opr=del&cust_id=<?=$_GET[cust_id]?>&odn_cartid=<?=$r[odn_cartid]?>' style='color:red' onclick='if(confirm("Are you sure to delete ?")) return true; else return false;'>del</a></td>
</tr>
<?
	$ii++;
	}
?>
</table>
<?
}	
?>